package com.demo.controller;

import com.demo.feign.CustomServiceApi;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.io.IOException;

/**
 * @author yexi
 */
@RestController("client")
@Api(tags = {"这是请求端"})
@EnableSwagger2
public class ClientController {

    @Autowired
    CustomServiceApi customServiceApi;

    @GetMapping("/test")
    public String test() throws IOException {
        Integer result1 = customServiceApi.test1(1, 2);
        System.out.println("the result1 is " + result1);
        Integer result2Get = customServiceApi.test2Get();
        System.out.println("the result2 is " + result2Get);
        Integer result2Post = customServiceApi.test2Post();
        System.out.println("the result2 is " + result2Post);
        String result3 = customServiceApi.test3();
        System.out.println("the result3 is " + result3);
        String result4 = customServiceApi.test4();
        System.out.println("the result4 is " + result4);
        String result5 = customServiceApi.test5();
        System.out.println("the result5 is " + result5);
        String result6 = customServiceApi.test6();
        System.out.println("the result6 is " + result6);
        String result7 = customServiceApi.test7();
        System.out.println("the result7 is " + result7);
        String result8 = customServiceApi.test8();
        System.out.println("the result8 is " + result8);
        return "success";
    }

}
